import { modelOptions, prop, Ref } from "@typegoose/typegoose";
import { Personage } from "./personage.model";
import { User } from "./User.model";
import { Works } from "./works.model";


@modelOptions({
    schemaOptions:{
        timestamps: true
    }
})

export class Comment{

    @prop({ref: 'User'})
    user: Ref<User>

    @prop({ enum: ['Works', 'Personage'] })
    type: string

    @prop({ refPath: 'type' })
    object: Ref<Works|Personage>

    @prop()
    content: string
}